import { createRouter, createWebHistory } from 'vue-router'

import LoginVue from '@/views/Login.vue'
import LayoutVue from '@/views/Layout.vue'
import HomeVue from "@/views/Home.vue"
import AdminAvatarVue from "@/views/admin/AdminAvatar.vue";
import AdminInfoVue from "@/views/admin/AdminInfo.vue";
import AdminResetPasswordVue from "@/views/admin/AdminResetPassword.vue";
import EmployeeManageVue from "@/views/employee/EmployeeManage.vue";
import DepartmentVue from "@/views/department/DepartmentManage.vue";
import LeaveVue from "@/views/leave/LeaveManage.vue";
import AttendanceManageVue from '@/views/attendance/AttendanceManage.vue';
import ExpenseManageVue from '@/views/expense/ExpenseManage.vue';
import TaskManageVue from '@/views/task/TaskManage.vue';
import messageManageVue from '@/views/message/messageManage.vue';
import NoticeManageVue from '@/views/notice/NoticeManage.vue';

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: '/login', component: LoginVue },
    {
      path: '/', component: LayoutVue, redirect: '/index', children: [
        { path: '/index', component: HomeVue },
        { path: '/department', component: DepartmentVue },
        { path: '/user', component: EmployeeManageVue },
        { path: '/leave', component: LeaveVue },
        { path: '/attendance', component: AttendanceManageVue },
        { path: '/expense', component: ExpenseManageVue },
        { path: '/task', component: TaskManageVue },
        { path: '/message', component: messageManageVue },
        { path: '/notice', component: NoticeManageVue },
        // { path: '/user/info', component: LeaveVue },
        { path: '/info', component: AdminInfoVue },
        { path: '/user/avatar', component: AdminAvatarVue },
        { path: '/user/resetPassword', component: AdminResetPasswordVue },
      ]
    }
  ]
})

export default router
